import moment from "moment"
export function friendTime(timer:number){
    const diff = (Date.now() - timer)/1000
    if(diff<30){
        return "刚刚"
    }else if(diff<60*60){
        return Math.ceil(diff/60) + '分钟前'
    }else if(diff<60*60*24){
        return Math.ceil(diff/60/60) + '小时前'
    }else if(diff<60*60*24*2){
        return '2天前'
    }else{
        return moment(timer).format("YYYY年MM月DD日 HH:mm")
    }
}
